Pragma

The first line in the source file is a pragma directive which tells that the

source code is written for Solidity version 0.4.0 or anything newer that does

not break functionality up to, but not including, version 0.6.0.

Always, a pragma directive is local to a source file, and if you import

another file, the pragma from that file will not automatically apply to the

importing file.

A pragma for a file that will not compile earlier than version 0.4.0 and will

also not work on a compiler starting from version 0.5 .0 is written as

follows:

pragma solidity ^ 0.4.0;

The second condition is added by using ^ .

Contract

On the Ethereum blockchain, a collection of code and data that reside at a

specific address is a contract.

The line uint sData declares a state variable called sData of type uint, and

the functions set and get are used to modify or retrieve the value of the

variable.

File import

Solidity supports the import statement. All global symbols from the

“filename” will be imported by the statement.

import "filename";

The statement import * as sName from "filename"; creates a new global

symbol sName whose members are all the global symbols from "filename",

U se import "./k" as k to import a file k from the same directory as the

current file; instead, if you use import " k" as k; a different file could be

referenced in a global " include directory" .

Keywords

The keywords are reserved for the compiler to use; they are the instructions,

which when used in a program, instruct the compiler to perform a specific

task for us.